<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>
<script>
/*    json全称 :js的对象表示法（ 它是一个对象）
      json作用： 它是一种数据交换格式 （它替代了使用xml来交换数据）
      { }；表示一个js对象
       特点： 键值对
       获得json对象的值 使用 点 . 操作符

*/
    //let person={"id":10001,"name":"李菊花",'gender':"男",'age':18};
   //console.log(person.id,person.name,person.gender,person.age);
   // let dog ={"id":1,"name":"小花"}
   // let person={"id":10001,"name":"李菊花",'gender':"男",'age':18,"dog":dog}

  // let person={"id":10001,"name":"李菊花",'gender':"男",'age':18,"dog":{"id":1,"name":"小花"}}
  // console.log(person.dog.name);

// let person={"id":10001,"name":"李菊花",'gender':"男",'age':18,
//             "dog":{"id":1,"name":"小花"},"citys":["成都","哈尔滨","大连"]}
//   console.log(person.citys[1]);
/*let person={"id":10001,"name":"李菊花",'gender':"男",'age':18,
          "dog":{"id":1,"name":"小花"},"citys":[{'id':1,'name':"成都"},{'id':2,'name':"哈尔冰"}]}

  console.log(person.citys[1].name);*/

let personList=[
    {"id":10001,"name":"李菊花",'gender':"男",'age':18,
        "dog":{"id":1,"name":"小花"},"citys":[{'id':1,'name':"成都"},{'id':2,'name':"哈尔冰"}]},
    {"id":10002,"name":"王菊花",'gender':"女",'age':20,
        "dog":{"id":2,"name":"小黑"},"citys":[{'id':1,'name':"成都"},{'id':3,'name':"大连"}]},
    {"id":10003,"name":"赵菊花",'gender':"男",'age':25,
        "dog":{"id":3,"name":"小黄"},"citys":[{'id':4,'name':"西安"},{'id':4,'name':"海南"}]}
];

personList.forEach((person)=>{
    console.log(`${person.name},${person.dog.name},${person.citys[0].name}`);
})






</script>

